<?php
namespace Managers;
use \Site\Metro as AreasEntity;

class Metro extends BaseManager{
    public function getAll(){
        return $this->getEntityManager()
                ->createQueryBuilder()
                ->select('n')
                ->from('Site\Metro', 'n')
                ->orderBy('n.id', '')
                ->getQuery()
                ->getResult();
    }

    public function getOne($areas, $id){
        return $this->getEntityManager()
                ->createQueryBuilder()
                ->select('n')
                ->from('Site\Metro', 'n')
                ->where('n.id = :id')
                ->andwhere('n.areas = :areas')
                ->getQuery()
                ->setParameters(array('id'=>$id, 'areas'=>$areas))
                ->getSingleResult();
    }

}
